1 //-------------------------------------------------------------------------------------------------
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //-------------------------------------------------------------------------------------------------
26 class ConstIterator
: public virtual IConstIterator
<T
>
33 explicit ConstIterator(RefCountedPtr
<IConstIterator
<T
> > spIterator
)
34 : m_spIterator(spIterator
)
40 ConstIterator(const U
& it
)
42 m_spIterator
.Attach(new (zeromemory
) U(it
));
50 return m_spIterator
->MoveNext();
54 // NULL is used to represent an empty iterator
62 ThrowIfFalse2(m_spIterator
, "Calling current on a NULL iterator");
63 return m_spIterator
->Current();
68 // Allow default copy constructor and assignment operators to
69 // be generated because RefCountedPtr is copy safe
70 RefCountedPtr
<IConstIterator
<T
> > m_spIterator
;